/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package presentacion;

import java.awt.Component;
import java.awt.Label;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.table.TableCellRenderer;

/**
 *
 * @author Alejandro
 */
public class CheckBoxRenderer implements TableCellRenderer{
     public Component getTableCellRendererComponent(JTable table, Object value,
            boolean isSelected, boolean hasFocus, int row, int column) {
        if (value == null) {
            return null;
        }    
        if(value instanceof Label)
            return (Component) value;
        
        JCheckBox c=(JCheckBox) value;
        c.setHorizontalAlignment(SwingConstants.CENTER);
        return c;
    }  
}
